using System;
using Magiq.Delete;
using Magiq.Insert;
using Magiq.Query;
using Magiq.Support;
using Magiq.Update;

namespace Magiq
{
    public abstract class MagiqProvider : IComparable<MagiqProvider>
    {
        public abstract IUpdateStrategy GetUpdateStrategy<T>(IUpdate<T> update) where T : class;
        public abstract IDeleteStrategy GetDeleteStrategy<T>(IDelete<T> delete) where T : class;
        public abstract IInsertStrategy GetInsertStrategy<TSource, TDestination, TNew>(IInsert<TSource, TDestination, TNew> insert) where TDestination : class where TNew : class, TDestination, new();
        public abstract IInsertDestination<TNew> GetInsertDestination<TSource, TDestination, TNew>(IInsert<TSource, TDestination, TNew> insertDestinationDefinition) where TDestination : class where TNew : class, TDestination, new();

        public abstract IQueryStrategy<TChild> GetQueryStrategy<T, TChild>(QueryInfo<T, TChild> queryInfo) where T : class;
        public abstract MagiqProviderOrderStrategy OrderStrategy { get; }

        public int CompareTo(MagiqProvider other)
        {
            return OrderStrategy.CompareTo(other.OrderStrategy);
        }
    }
}